<?php  
class ControllerModuleCounter extends Controller {
	protected function index($setting) {
		$this->language->load('module/counter');
		$this->load->model('catalog/counter');
    	$this->data['heading_title'] = sprintf($this->language->get('heading_title'), $this->config->get('config_name'));
    	
		if(!isset($this->session->data['online']))
		{
			$this->model_catalog_counter->updateVisiter();
			$this->session->data['online']=1;
		}
		$this->data['truycap']=$this->model_catalog_counter->getvisiter();
		$this->data['online']=$this->model_catalog_counter->getUserOnline();
		$this->data['text_luottruycap']=$this->language->get('text_luottruycap');
		$this->data['text_online']=$this->language->get('text_online');

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/counter.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/module/counter.tpl';
		} else {
			$this->template = 'default/template/module/counter.tpl';
		}
		
		$this->render();
	}
}
?>